Skip to content

[management] Code generation: update services and models - #2067

Open
AdyenAutomationBot wants to merge 2 commits into
mainfrom
sdk-automation/management
Open

AdyenAutomationBot wants to merge 2 commits into
mainfrom
sdk-automation/management

Conversation

@AdyenAutomationBot

@AdyenAutomationBot AdyenAutomationBot commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the management service.

Adyen/adyen-openapi@45520ee

The commit history of this PR reflects the adyen-openapi commits that have been applied.

Breaking Changes 🛠

  • Rename submitterId to alternateMerchantNumber in ValuelinkInfo and ValuelinkResponseInfo.

New Features 💎

Terminal themes

  • Add terminal theme APIs.
  • TrminalThemesCompanyLevelApi and TerminalThemesMerchantLevelApi let you list, create, get, update, delete, apply and unapply themes.
  • They can also add, edit and delete theme assets, which are uploaded as a multipart File.
  • TerminalThemesStoreLevelApi and TerminalThemesTerminalLevelApi let you apply and unapply themes.
  • Add the theme models CreateThemeRequest, CreateThemeResponse, ThemeUpdateRequest, UpdateThemeResponse, ListThemesResponse, ThemeSummary, ThemeWithAssetDetails, ThemeAsset and the ThemeMode enum (DARK,LIGHT).

Client certificates

  • Add ClientCertificatesCompanyLevelApi with generateClientCertificate (POST /companies/{companyId}/clientCertificates) and listClientCertificates (GET /companies/{companyId}/clientCertificates).
  • Add the models ClientCertificateRequest (apiCredential, certificateSigningRequest), ClientCertificateWithChain (caChain, id, leaf, serialNumber, subjectDN) and CertificateSearchResponse (data)

Payment method settings

  • Add the models AncvInfo and AncvResponseInfo, each with a shopId field.
  • Add the ancv field to PaymentMethodSetupInfo and PaymentMethod.
  • Add the models EbtInfo, EbtResponseInfo and EbtUpdateInfo, each with a fnaNumber field.
  • Add the ebt field to PaymentMethodSetupInfo, PaymentMethod and UpdatePaymentMethodInfo.
  • Add the enum values ANCV, EBT and WERO to PaymentMethodSetupInfo.TypeEnum and PaymentMethodResponse.TypesWithErrorsEnum.
  • Add the merchantCategoryCode and mid fields to PaymentMethod.
  • Add the branchName, merchantMobileAppName and productServiceDescription fields to AlipayPlusInfo. All three are required for TrueMoney.

Split configuration

  • Add the cardUsageType field and the CardUsageTypeEnum enum (COMMERCIAL, CONSUMER, ANY) to SplitConfigurationRule and UpdateSplitConfigurationRuleRequest.

Terminal settings

  • Add the showCalculatedPercentageTippingAmount field to TerminalSettings.

Other Changes 🖇️

  • Deprecate Surcharge.disclosureOnPresentCard. The field, its builder method, getter and setter are now marked @deprecated.
  • Update the Javadoc for:
    - AssociatedPaymentMethod.type and PaymentMethodSetupInfo.type, which now point to the cartesBancaires object for cartebancaire.
    - SplitConfigurationRule.cardRegion, which drops the "pilot phase" note.
    - AndroidFilesCompanyLevelApi, where the upload method summary is now "Upload Android certificate".

@AdyenAutomationBot
AdyenAutomationBot requested a review from a team as a code owner September 23, 2026 12:28

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several new models and API services to support terminal theme management and client certificate generation, while also updating existing payment method models with new fields and documentation. I have identified a high-severity issue regarding incorrect equality and hash code implementation for the List<byte[]> field in ClientCertificateWithChain and a medium-severity inconsistency where the name field in ThemeUpdateRequest is typed as Object instead of String. Please address these concerns to ensure correct object comparison and type consistency across the SDK.

Comment on lines +288 to +322
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClientCertificateWithChain clientCertificateWithChain = (ClientCertificateWithChain) o;
return Objects.equals(this.caChain, clientCertificateWithChain.caChain)
&& Objects.equals(this.isSetCaChain, clientCertificateWithChain.isSetCaChain)
&& Objects.equals(this.id, clientCertificateWithChain.id)
&& Objects.equals(this.isSetId, clientCertificateWithChain.isSetId)
&& Arrays.equals(this.leaf, clientCertificateWithChain.leaf)
&& Objects.equals(this.isSetLeaf, clientCertificateWithChain.isSetLeaf)
&& Objects.equals(this.serialNumber, clientCertificateWithChain.serialNumber)
&& Objects.equals(this.isSetSerialNumber, clientCertificateWithChain.isSetSerialNumber)
&& Objects.equals(this.subjectDN, clientCertificateWithChain.subjectDN)
&& Objects.equals(this.isSetSubjectDN, clientCertificateWithChain.isSetSubjectDN);
}

@Override
public int hashCode() {
return Objects.hash(
caChain,
isSetCaChain,
id,
isSetId,
Arrays.hashCode(leaf),
isSetLeaf,
serialNumber,
isSetSerialNumber,
subjectDN,
isSetSubjectDN);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The caChain field is of type List<byte[]>. In Java, calling Objects.equals() on a List compares its elements using their equals() method. For byte[] arrays, equals() performs reference equality (==) rather than content equality. This means two ClientCertificateWithChain instances with identical certificate chains (same byte values but different array instances) will be considered unequal.

Similarly, Objects.hash(caChain) computes the hash code using the default identity hash codes of the byte[] elements, leading to inconsistent hash codes for identical content.

To fix this, we should implement custom helper methods to compare and hash the list of byte arrays by content.

  private boolean equalCaChains(List<byte[]> list1, List<byte[]> list2) {
    if (list1 == list2) {
      return true;
    }
    if (list1 == null || list2 == null) {
      return false;
    }
    if (list1.size() != list2.size()) {
      return false;
    }
    for (int i = 0; i < list1.size(); i++) {
      if (!Arrays.equals(list1.get(i), list2.get(i))) {
        return false;
      }
    }
    return true;
  }

  private int hashCodeCaChain(List<byte[]> list) {
    if (list == null) {
      return 0;
    }
    int result = 1;
    for (byte[] element : list) {
      result = 31 * result + Arrays.hashCode(element);
    }
    return result;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ClientCertificateWithChain clientCertificateWithChain = (ClientCertificateWithChain) o;
    return equalCaChains(this.caChain, clientCertificateWithChain.caChain)
        && Objects.equals(this.isSetCaChain, clientCertificateWithChain.isSetCaChain)
        && Objects.equals(this.id, clientCertificateWithChain.id)
        && Objects.equals(this.isSetId, clientCertificateWithChain.isSetId)
        && Arrays.equals(this.leaf, clientCertificateWithChain.leaf)
        && Objects.equals(this.isSetLeaf, clientCertificateWithChain.isSetLeaf)
        && Objects.equals(this.serialNumber, clientCertificateWithChain.serialNumber)
        && Objects.equals(this.isSetSerialNumber, clientCertificateWithChain.isSetSerialNumber)
        && Objects.equals(this.subjectDN, clientCertificateWithChain.subjectDN)
        && Objects.equals(this.isSetSubjectDN, clientCertificateWithChain.isSetSubjectDN);
  }

  @Override
  public int hashCode() {
    return Objects.hash(
        hashCodeCaChain(caChain),
        isSetCaChain,
        id,
        isSetId,
        Arrays.hashCode(leaf),
        isSetLeaf,
        serialNumber,
        isSetSerialNumber,
        subjectDN,
        isSetSubjectDN);
  }

Comment on lines +76 to +77
public static final String JSON_PROPERTY_NAME = "name";
private Object name;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The name field in ThemeUpdateRequest is defined as Object, whereas in all other theme-related models (CreateThemeRequest, ThemeSummary, ThemeWithAssetDetails, UpdateThemeResponse), it is typed as String. This inconsistency reduces type safety and makes the SDK harder to use. Consider updating the OpenAPI specification or generator configuration to ensure name is consistently typed as String.

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 5 times, most recently from 45a0cd1 to 8e16dc7 Compare September 28, 2026 10:18
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 3 times, most recently from 94e0aed to 5c9bb3f Compare October 1, 2026 14:42
@andrej-gajduk-adyen
andrej-gajduk-adyen removed their request for review October 5, 2026 11:29
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch from 5c9bb3f to 255ff4d Compare October 5, 2026 12:36
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch from 255ff4d to b15e538 Compare October 8, 2026 14:22
@poojah-adyen poojah-adyen added the Breaking change Indicates a change that has caused a major version update label Oct 13, 2026
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking change Indicates a change that has caused a major version update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants